* ======================================
* --------- Network co-workers ---------
* ======================================


	use $dta\ImportWork15.dta, clear
	
	drop if WorkSize > 100 // Restrict to SMEs (<= 100 employees)
	
	* Personal characteristics
	gen year = 2015
	merge 1:1 idPers using $dta\ImportPers.dta, nogen keep(matched)
	drop year
	
	
* Work1net (narrow)
* =================

	preserve
	
	* Generate age bins
	gen age = 2015 - birthyear
	gen agegr = 1
	replace agegr = 2 if age >= 35
	replace agegr = 3 if age >= 50
	egen Work1net = group(idWork agegr)
	gen Work1 = 1
	
	keep idPers Work1 Work1net
	save $dta\NetworkWork1.dta, replace
	
	restore

	
* Work2net (broad)
* ================
	
	preserve
	
	egen Work2net = group(idWork)
	gen Work2 = 1
	
	keep idPers Work2 Work2net
	save $dta\NetworkWork2.dta, replace
	
	restore

	
